import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'tab',
      redirect: '/home',
      component: () => import('@/pages/tab/Tab'),
      children: [
        {
          path: '/home',
          component: () => import('@/pages/tab/home/Home')
        }, {
          path: '/world',
          component: () => import('@/pages/tab/world/World'),
        }, {
          path: '/route',
          component:  () => import('@/pages/tab/route/Route')
        }, {
          path: '/mine',
          component: () => import('@/pages/tab/mine/Mine'),
        },
      ]
    }, {
      path: '/addRouteDemand',
      component: () => import ('@/pages/common/route/AddRouteDemand')
    }, {
      path: '/addRouteService',
      component: () => import ('@/pages/common/route/AddRouteService')
    }, {
      path: '/about',
      component: () => import ('@/pages/tab/mine/About'),
    }, {
      path: '/personal/:id/:access',
      component: () => import ('@/pages/common/personal/Personal'),
    }, {
      path: '/personalData/:id',
      component: () => import ('@/pages/common/personal/PersonalData'),
    }, {
      path: '/personalDataEdit/:id',
      component: () => import ('@/pages/common/personal/PersonalDataEdit'),
    }, {
      path: '/routeServDetail/:id/:creator',
      component: () => import('@/pages/common/route/RouteServDetail'),
    }, {
      path: '/routeReqDetail/:id/:creator',
      component:  () => import('@/pages/common/route/RouteReqDetail'),
    }, {
      path: '/routeList',
      component: () => import('@/pages/common/route/RouteList'),
    }, {
      path: '/guideList',
      component: () => import('@/pages/common/GuideList'),
    }, {
      path: '/search',
      component: () => import('@/pages/common/Search'),
    }, {
      path: '/cityGuide/:cityId',
      component: () => import('@/pages/common/CityGuide'),
    }, {
      path: '/city',
      component: () => import('@/pages/common/City'),
    }, {
      path: '/destCity',
      component: () => import('@/pages/common/DestCity'),
    }, {
      path: '/login',
      component: () => import('@/pages/login/Login'),
    }, {
      path: '/register',
      component: () => import('@/pages/login/Register'),
    }, {
      path: '/401',
      name: 'error_401',
      meta: {
        hideInMenu: true
      },
      component: () => import('@/pages/error/401.vue')
    }, {
      path: '/500',
      name: 'error_500',
      meta: {
        hideInMenu: true
      },
      component: () => import('@/pages/error/500.vue')
    }, {
      path: '*',
      name: 'error_404',
      meta: {
        hideInMenu: true
      },
      component: () => import('@/pages/error/404.vue')
    },

  ]
})
